package com.sinitek.enums;

import lombok.Getter;

/**
 * @program: elastic
 * @description: Api相应枚举
 * @author: Mr.chen
 * @create: 2019-04-24 12:50
 */
@Getter
public enum ApiResultEnum {

    SUCCESS(200, "请求成功"),
    FAIL(900, "请求失败"),

    OPERATE_FAIL(600, "操作失败"),

    BAD_REQUEST(400, "参数解析失败"),
    METHOD_NOT_ALLOWED(405, "不支持当前请求方法"),

    UNKNOWN_ERROR(-1, "未知错误"),
    SYSTEM_ERR(1000, "系统异常"),

    PARAM_IS_INVALID(10001, "参数无效"),
    PARAM_IS_BLANK(10002, "参数为空"),
    PARAM_TYPE_BIND_ERROR(10003, "参数类型错误"),
    METHOD_TYPE_BIND_ERROR(10004, "方法参数类型错误"),
    METHOD_NOT_ALLOW(10005, "不允许的请求方式"),
    PARAM_NOT_COMPLETE(10006, "缺少请求参数"),
    UNSUPPORTED_MEDIA_TYPE(10007, "不支持当前媒体类型"),
    ILLEGAL_ARGUMENT(10008, "非法参数异常"),

    RESULT_DATA_NONE(50001, "数据未找到"),
    DATA_IS_WRONG(50002, "数据有误"),
    DATA_ALREADY_EXISTED(50003, "数据已存在"),
    DATABASE_OPERATE_ERROR(50004, "操作数据库出现异常");

    private Integer code;
    private String msg;

    ApiResultEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

}
